<%--
  Created by IntelliJ IDEA.
  User: gaoxiang
  Date: 2017/3/14
  Time: 10:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>牛头崖镇行政综合服务中心满意度评价系统</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile      -web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <script type="text/javascript" src="/static/css/new_file.js"></script>
    <link rel="stylesheet" type="text/css" href="/static/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="/static/iconfont/iconfont.css" />
</head>
<body style="background: #fb724e;">
<div class="left_iconfont">
    <a href="#"><span  class="iconfont">&#xe65c;</span><b>牛头崖镇行政综合服务中心满意度评价系统</b></a>
</div>
<div class="Box_maxWidth">
    <div class="contentBox">
        <dl>
            <dt><img src="${users.headImg}"/></dt>
            <dd>
                <p>姓名：<span>${users.name}</span></p>
                <p>性别：<span>${users.sex}</span></p>
                <p>职位：<span>${users.position}</span></p>
                <p>工号：<span>${users.number}</span></p>
            </dd>
        </dl>
    </div>

    <%-- 隐藏域--%>
    <input type="hidden" id="workersId" value="${users.id}">
    <input type="hidden" id="workersName" value="${users.name}">

    <div class="contentBox02">
        <h2>请选择您的满意程度：</h2>
        <div class="content_list">
            <div class="ul_Table c_table">
                <li value="3"><i class="iconfont">&#xe63e;</i>非常满意</li>
                <li value="2"><i class="iconfont">&#xe8db;</i>满意</li>
                <li value="1"><i class="iconfont">&#xe6dd;</i>一般</li>
                <li value="0"><i class="iconfont">&#xe605;</i>不满意</li>
            </div>
            <div class="rc_listCon">
                <div class="tc_shopBox mc_rc"></div>
                <div class="tc_shopBox mc_rc"></div>
                <div class="tc_shopBox mc_rc">
                    <div class="input_pot">
                        <textarea type="text" id="feedbackInfo" placeholder="请输入您的反馈信息" maxlength="100" ></textarea>
                    </div>
                </div>
                <div class="tc_shopBox mc_rc">
                    <h3>请您提出宝贵意见</h3>
                    <div class="input_pot">
                        <div class="input_div">
                            <label>姓&nbsp;&nbsp;&nbsp;名：</label>
                            <input type="text" id="userName" maxlength="50" placeholder="请输入您的姓名" />
                        </div>
                        <div class="input_div">
                            <label>手机号：</label>
                            <input id="userPhone" type="text" maxlength="11" placeholder="请输入您的联系方式" />
                        </div>
                        <div class="input_div">
                            <textarea type="text" id="resumeReason" maxlength="255" placeholder="请简述您的反馈事项"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="botton" onclick="tijiao()">提 交</div>
    </div>
</div>

</body>
<script src="/static/js/jquery.js"></script>
<script src="/static/js/tools.js"></script>
<%--<script src="/static/js/layer.js"></script>--%>
<script>
    $(function(){
        //选项卡
        $(".ul_Table li:eq(0)").addClass("li_active");
        $(".rc_listCon .mc_rc").not(":first").hide();
        $(".ul_Table li").click(function(){
            $(this).addClass("li_active").siblings().removeClass("li_active");
            var index=$(this).index();
            $(".rc_listCon .mc_rc").eq(index).show().siblings().hide();
        })
    })


    function tijiao(){
        var workersId = $("#workersId").val();
        var workersName = $("#workersName").val();

        $.each($(".c_table li"),function(){
            var self=$(this);
            if (self.hasClass("li_active")){
                var ratingType = self.val();
                if(ratingType == 1){
                    var feedbackInfo = $("#feedbackInfo").val();
                        $.post("/app/evaluateUser/saveUserFeedBackInfo", {"workersId":workersId,"workersName":workersName,"feedbackInfo":feedbackInfo,"ratingType":ratingType}, function (data) {
                            if(data.success){
                                window.location.href = "http://147.114.136.187:8080/app/evaluateUser/successIndex";
                            }else{
                                alert(data.msg);
                            }
                        });
                }else if(ratingType == 0){
                    var userName = $("#userName").val();
                    var userPhone = $("#userPhone").val();
                    var resumeReason = $("#resumeReason").val();
                    $.post("/app/evaluateUser/saveUserFeedBackInfo", {"workersId":workersId,"workersName":workersName,"userName":userName,"ratingType":ratingType,"userPhone":userPhone,"resumeReason":resumeReason}, function (data) {
                        if(data.success){
                            window.location.href = "http://47.114.136.187:8080/app/evaluateUser/successIndex";
                        }else{
                            alert(data.msg);

                        }
                    });
                }else{
                    $.post("/app/evaluateUser/saveUserFeedBackInfo", {"workersId":workersId,"workersName":workersName,"ratingType":ratingType}, function (data) {
                        if(data.success){
                            window.location.href = "http://47.114.136.187:8080/app/evaluateUser/successIndex";
                        }else{
                            alert(data.msg);
                        }
                    });
                }
            }
        });
    }
</script>
</html>